package com.jy.api.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;
import java.util.Map;

/**
 * Created by lihu on 2018/2/3.
 */
public class StockCheckTransactionDaoImpl {


    @Autowired
    JdbcTemplate jdbcTemplate;


    public List<Map<String, Object>> queryCheckOrderId(String checkOrderId) {
        String sql = "select product_name productName,accurate_whole_qty accurateWholeQty," +
                " accurate_single_qty accurateSingleQty,check_single_qty checkSingleQty," +
                " check_whole_qty checkWholeQty,notes," +
                " (ABS(check_single_qty-accurate_single_qty)+ABS(accurate_whole_qty-check_whole_qty)) difference " +
                " from stock_check_transaction  where check_order_id=? order by difference desc ";

        return jdbcTemplate.queryForList(sql, checkOrderId);
    }
}
